<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>在线漫画--章节内容浏览</title>
    <link rel="stylesheet" href="/back/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/back/css/bootstrap.min.css">
</head>
<body>
<style>
    img{
        width: 200px;
        height: 100px;
    }
    .th1{
        width:200px;
        font-family: 宋体;
        text-align: center;
    }
    .th2{
        width:300px;
        font-family: 宋体;
        text-align: center;
    }
    .th3{
        width:60px;
        font-family: 宋体;
        text-align: center;
    }
    .table-bordered td,.table-bordered th{
        border:2px solid #5bc0de!important
    }
    .btn-primary{
        float:left;
        margin-left: 50px;
    }
</style>
<div class="container">
    <p>

    <div class="row">
        <a href="/back/content/cList.php">
            <button type="button" class="btn btn-primary" >返回首页</button>
        </a>

    </div>

    </p>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th class="th2">作品名</th>
            <th class="th3">章节序号</th>
            <th class="th2">章节封面图片</th>
            <th class="th1">章节名称</th>
            <th class="th2">章节内容图片</th>
            <th class="th1">章节发布时间</th>
            <th class="th1">操作</th>
        </tr>
        </thead>
        <tbody>
<!--    <div class="page-header">漫画内容信息列表</div>-->
    <?php
    // 判断是否有参数
    if(empty($_POST["proName"])) {
        die("作品名不能为空！");
    }
    //  获取参数，根据参数生成insert 语句
    $name = $_POST["proName"]; // 接收漫画作品ID

    //查询作品集数与内容

    $sql= "select content.proId,production.name,content.section,content.sectionImg,content.sectionName,content.imgUrl,content.publicTime from content inner join production on content.proId=production.id and production.name like'%$name%'";
    include_once dirname(__FILE__) .'../../common/conn.php';
    $res= mysqli_query($con,$sql);
    mysqli_close($con);
    if(!$res){
        die("查询错误！");
    }
    //判断是否有查到漫画内容
    if($res) // 如果查询失败
    {
        while($row = mysqli_fetch_array($res))
        {
            ?>
            <tr>
                <td class="th2"><?php echo $row["name"] ?></td>
                <td class="th3"><?php echo $row["section"] ?></td>
                <td class="th2">
                    <img src="<?php echo $row["sectionImg"] ?>" />
                </td>
                <td class="th1"><?php echo $row["sectionName"] ?></td>
                <td class="th2">
                    <img src="<?php echo $row["imgUrl"] ?>" />
                </td>
                <td class="th1"><?php echo $row["publicTime"] ?></td>
                <td class="th1">
                    <!-- 编辑-->
                    <a href="contentEdit.php?proId=<?php echo $row["proId"]?> && section=<?php echo $row["section"] ?>" class="btn btn-xs btn-warning">
                        <span class="glyphicon glyphicon-pencil"></span>
                    </a>
                    <!--删除-->
                    <a href="contentDelete.php?proId=<?php echo $row["proId"]?> && section=<?php echo $row["section"] ?>" class="btn btn-xs btn-warning" onClick="return confirm('确定删除?');">
                        <span class="glyphicon glyphicon-trash"></span>
                    </a>
                    <!--预览-->
                    <a href="contentView.php?proId=<?php echo $row["proId"]?> && section=<?php echo $row["section"] ?>" class="btn btn-info btn-xs">预览</a>

                </td>
            </tr>
        <?php    }
    }
    ?>
</div>
</body>
</html>